//
//  OuterPopulationListViewController.m
//  Utils
//
//  Created by enghou on 2018/4/25.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//  

#import "OuterPopulationListViewController.h"
#import "OuterPopulationViewController.h"
#import "PopulationSearchViewController.h"
#import "OuterSearchViewController.h"
@interface OuterPopulationListViewController ()<TotalProtocol>


@property(nonatomic,strong)NSMutableDictionary *p;
@end

@implementation OuterPopulationListViewController

-(NSDictionary *)param{
    return self.p;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"境外人员";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)searchAction{
    OuterSearchViewController *p = (OuterSearchViewController *)[VCLoader vcWithName:@"OuterSearchViewController"];
    p.theDelete = self;
    p.title = @"境外人员查询";
    [self push:p];
}
-(void)pushWithId:(NSString *)ids{
    OuterPopulationViewController *outer = (OuterPopulationViewController *)[VCLoader vcWithName:@"OuterPopulationViewController"];
    outer.canEdit = NO;
    outer.theDelete = self;
    outer.title = @"境外人员详情";
    outer.ids = ids;
    [self push:outer];
}
#pragma mark - Table view data source
//-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//    PopulationItemModel *model = [self.source objectAtIndex:indexPath.row];
//    OuterPopulationViewController *outer = (OuterPopulationViewController *)[VCLoader vcWithName:@"OuterPopulationViewController"];
//    outer.canEdit = NO;
//    outer.theDelete = self;
//    outer.title = @"境外人员详情";
//    outer.ids = model.ids;
//    [self push:outer];
//}

-(void)fetchModel:(id)model{
    //得到参数
    if (!self.p) {
        self.p = [NSMutableDictionary dictionary];
    }
    if ([model isKindOfClass:[NSDictionary class]]) {
        [self.p addEntriesFromDictionary:model];
    }else if ([model isKindOfClass:[NSString class]]){
        self.p[@"overseaPersonnel.organization.id"] = model;
    }
    [self beginRefresh];
}
@end
